<div [@routerTransition]>
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>交接单</span>
                </h3>
                <button type="button" style="margin-left: 25px;" class="btn btn-sm m-btn--gradient-from-accent m-btn--gradient-to-success"
                    (click)="batchPrintJjdModal.show(selectedpipe)" *ngIf="permission.isGranted('Pages.Jjd.Operation')">
                    打印交接单
                </button>
            </div>
            <div class="col text-right mt-3 mt-md-0">
                
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <form class="horizontal-form" autocomplete="off">
                    <div class="m-form m-form--label-align-right">
                        <div class="row align-items-center m--margin-bottom-10">
                            <div class="col-xl-12">
                                <div class="form-group m-form__group align-items-center">
                                    <div class="input-group">
                                        <input [(ngModel)]="filterText" name="filterText" autoFocus class="form-control m-input" [placeholder]="
                                                l('SearchWithThreeDot')
                                            " type="text" />
                                        <span class="input-group-btn">
                                            <button (click)="getDeliveryRecords()" class="btn btn-primary" type="submit">
                                                <i class="flaticon-search-1" [attr.aria-label]="
                                                        l('Search')
                                                    "></i>
                                            </button>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row m--margin-bottom-10" [hidden]="!advancedFiltersAreShown">
                            <div class="col-md-6">
                                <div class="form-group">

                                </div>
                            </div>
                        </div>

                        <div class="row margin-bottom-10" *ngIf="advancedFiltersAreShown">
                            <div class="col-sm-12 text-right">
                                <button class="btn btn-metal" (click)="getDeliveryRecords()">
                                    <i class="fa fa-sync"></i>
                                    {{ l("Refresh") }}
                                </button>
                            </div>
                        </div>
                        <div class="row margin-bottom-10">
                            <div class="col-sm-12">
                                <span class="clickable-item text-muted" *ngIf="!advancedFiltersAreShown" (click)="
                                        advancedFiltersAreShown = !advancedFiltersAreShown
                                    ">
                                    <i class="fa fa-angle-down"></i>
                                    {{ l("ShowAdvancedFilters") }}</span>
                                <span class="clickable-item text-muted" *ngIf="advancedFiltersAreShown" (click)="
                                        advancedFiltersAreShown = !advancedFiltersAreShown
                                    ">
                                    <i class="fa fa-angle-up"></i>
                                    {{ l("HideAdvancedFilters") }}</span>
                            </div>
                        </div>
                    </div>
                </form>

                <div class="row align-items-center">
                    <!--<Primeng-TurboTable-Start>-->
                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                        <div class="m-pipeline">
                            <div class="table-responsive">
                                <table #dataTable class="table" id="pipe-table">
                                    <thead>
                                        <tr>
                                            <td style="width: 2%; text-align: center;" *ngIf="permission.isGranted('Pages.Jjd.Operation')">

                                            </td>
                                            <td class="m-pipeline__base_jjd">
                                                任务号
                                            </td>
                                            <td class="m-pipeline__base_jjd">
                                                图号
                                            </td>
                                            <td class="m-pipeline__base_jjd">
                                                任务名称
                                            </td>
                                            <td class="m-pipeline__status_jjd">
                                                交接车间
                                            </td>
                                            <td class="m-pipeline__time_jjd">
                                                合格证号
                                            </td>
                                            <td class="m-pipeline__node_jjd">
                                                合格数量
                                            </td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr *ngFor="let plan of primengTableHelper.records">
                                            <td *ngIf="permission.isGranted('Pages.Jjd.Operation')">
                                                <p-checkbox name="group1" value="{{ plan.batchId }}" [(ngModel)]="selectedpipe"></p-checkbox>
                                            </td>

                                            <td>
                                                <span>
                                                    {{ plan.batchCode }}
                                                </span>
                                            </td>
                                            <td>
                                                <span>
                                                    {{ plan.drawingCode }}
                                                </span>
                                            </td>
                                            <td>
                                                <span>
                                                    {{ plan.drawingName }}
                                                </span>
                                            </td>
                                            <td>
                                                <span>
                                                    {{ plan.destinationName }}
                                                </span>
                                            </td>
                                            <td>
                                                <span>
                                                    {{ plan.certificateId }}
                                                </span>
                                            </td>
                                            <td>
                                                <span>
                                                    {{ plan.certificateQuantity }}
                                                </span>
                                            </td>

                                        </tr>
                                    </tbody>
                                </table>

                                <!-- <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                                    {{ 'NoData' | localize }}
                                </div> -->
                                <div class="primeng-paging-container">
                                    <p-paginator [rows]="
                                    primengTableHelper.defaultRecordsCountPerPage
                                " #paginator (onPageChange)="getDeliveryRecords($event)" [totalRecords]="
                                    primengTableHelper.totalRecordsCount
                                " [rowsPerPageOptions]="
                                    primengTableHelper.predefinedRecordsCountPerPage
                                ">
                                    </p-paginator>
                                    <span class="total-records-count">
                                        {{ "总计:" + primengTableHelper.totalRecordsCount }}
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--<Primeng-TurboTable-End>-->
                </div>
            </div>
        </div>
    </div>
    <batchPrintJjdModal #batchPrintJjdModal (modalSave)="getDeliveryRecords($event)"></batchPrintJjdModal>
</div>

